import { stringify } from 'qs';
import request from '@/utils/request';

import webpath from '@/utils/webpath';

export async function deleteByPrimaryKeyForProTableAuth(params = {}) {
    return request(`/${webpath}/web/api/service/protableauth/delete?${stringify(params)}`);
}


export async function selectByPrimaryKeyForProTableAuth(params = {}) {
    return request(`/${webpath}/web/api/service/protableauth/get?${stringify(params)}`);
}


export async function insertForProTableAuth(params = {}) {
    return request(`/${webpath}/web/api/service/protableauth/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function updateForProTableAuth(params = {}) {
    return request(`/${webpath}/web/api/service/protableauth/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function deleteByMapForProTableAuth(params = {}) {
    return request(`/${webpath}/web/api/service/protableauth/deleteByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateByMapForProTableAuth(params = {}) {
    return request(`/${webpath}/web/api/service/protableauth/updateByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function getOneForProTableAuth(params = {}) {
    return request(`/${webpath}/web/api/service/protableauth/getOne`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}



export async function getAllForProTableAuth(params = {}) {
    return request(`/${webpath}/web/api/service/protableauth/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function queryPageForProTableAuth(params = {}) {
    return request(`/${webpath}/web/api/service/protableauth/queryPage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function countForProTableAuth(params = {}) {
    return request(`/${webpath}/web/api/service/protableauth/count`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function insertBatchForProTableAuth(params = {}) {
    return request(`/${webpath}/web/api/service/protableauth/insertBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function deleteBatchForProTableAuth(params = {}) {
    return request(`/${webpath}/web/api/service/protableauth/deleteBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateBatchForProTableAuth(params = {}) {
    return request(`/${webpath}/web/api/service/protableauth/updateBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function getPageProTablesByAuthId(params = {}) {
    return request(`/${webpath}/web/api/service/protableauth/getPageProTablesByAuthId`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}
export async function queryPageForProAuthority(params = {}) {
<<<<<<< HEAD
    return request(`/hrath/web/api/service/proauthority/queryPage`, {
=======
    return request(`/${webpath}/web/api/service/proauthority/queryPage`, {
>>>>>>> d8eca5bfb0c3fdab190e7955baa5788118c6937e
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function queryPageForProTableChild(params = {}) {
    return request(`/${webpath}/web/api/service/protables/queryPage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getSelectedProTableByAuthId(params = {}) {
    return request(`/${webpath}/web/api/service/protableauth/getSelectedProTablesByAuthId`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}
 